﻿using FitNesseRunner.Model;

namespace FitNesseRunner
{
	public class ScriptTableHandler : RegularTableHandler
	{
		private readonly IReporter _reporter;
		private readonly IContext _context;

		public ScriptTableHandler(IReporter reporter, IContext context)
			: base("script")
		{
			_reporter = reporter;
			_context = context;
		}

		public override void Handle(ITable table)
		{
			var scriptTable = new ScriptTable(table.Cells, _reporter, _context);
			scriptTable.ExecuteAll();
		}
	}
}
